package com.hb.core.pojo.center.sys.entity;

import com.hb.core.pojo.parent.MPCommonEntity;

import java.math.BigDecimal;

import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * <p>
 * 地区信息表
 * </p>
 *
 * @author zjk
 * @since 2021-05-24
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("sys_district_info")
@ApiModel(value = "DistrictInfo对象", description = "地区信息表")
public class DistrictInfo extends MPCommonEntity {

    @ApiModelProperty(value = "父级数据ID")
    private Long parentId;

    @ApiModelProperty(value = "地区名称")
    private String disName;

    @ApiModelProperty(value = "区域编码")
    private String areaCode;

    @ApiModelProperty(value = "区号(拨号前缀)")
    private String preCall;

    @ApiModelProperty(value = "地区名称首字母")
    private String preLetter;

    @ApiModelProperty(value = "邮编")
    private String postalCode;

    @ApiModelProperty(value = "层级")
    private Integer level;

    @ApiModelProperty(value = "排序号")
    private Integer sort;

    @ApiModelProperty(value = "经度")
    private BigDecimal lng;

    @ApiModelProperty(value = "纬度")
    private BigDecimal lat;

    /**
     * 参数验证方法
     * 所有的继承该类的DTO对象必须在调用时重写该方法
     * 该方法中验证的字段对应数据库中不能为空的字段
     *
     * @param fieldNames
     * @return
     */
    @Override
    public String paramsValid(String... fieldNames) {
        return super.paramsValid("disName", "areaCode");
    }
}
